/*
 * Line.h
 *
 *  Created on: 2011-02-23
 *      Author: kamil
 */

#ifndef LINE_H_
#define LINE_H_

#include "mgr/util/Vector2d.h"

class Line {
public:
	Line();
	Line(double x1, double y1, double x2, double y2);
	Line(const Vector2d & p1, const Vector2d & p2);
	virtual ~Line();

//	bool intersectsWith(const Line &);

	Vector2d intersectionPoint(const Line & other);

private:
//	/**
//	 * Represents interval from t1 to t2
//	 */
//	class Interval {
//	public:
//		Interval() : start(0), end(0) {}
//		Interval(double t1, double t2) : start(t2), end(t2) {}
//
//		bool contains(double nr);
//		bool intersectsWith(const Interval & );
//
//		double start, end;
//	};

	void calcLineParams();

	Vector2d p1;
	Vector2d p2;

	///line params
	double A;
	double B;
	double C;

//	Interval x;
//	Interval y;
};

#endif /* LINESEGMENT_H_ */
